﻿using System;
using Ornament.Domain;

namespace Products.Databases
{
    [Serializable]
    public class FieldSnapshot : DomainObject<Guid>, ISnapShot
    {
        protected FieldSnapshot()
        {
        }

        public FieldSnapshot(ProductVersion productVersion, ActionType state, Field field)
        {
            Version = productVersion;
            State = state;
            this.Field = field;
        }

        public virtual Field Field
        {
            get;
            private set;
        }

        public virtual string SqlType { get; set; }
        public virtual int Length { get; set; }

        #region ISnapShot Members

        public virtual string Name { get; set; }
        public virtual string Memo { get; set; }
        public virtual ProductVersion Version { get; private set; }
        public virtual ActionType State { get; private set; }
        public virtual string StateMemo { get; set; }

        #endregion

        protected override int CreateHashCode()
        {
            return Id.GetHashCode();
        }

        
    }
}